package com.myx.design.single.attack;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

/**
 * 描述:测试反射攻击
 * @author: myx
 * @date: 2018/11/28
 * Copyright © 2018-hotpot. All rights reserved.
 */
public class TestAttack {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
        System.out.println(SingleAttack.getInstance());
        Class<?> aClass = Class.forName("com.myx.design.single.attack.SingleAttack");
        Constructor<?> declaredConstructor = aClass.getDeclaredConstructor(null);
        declaredConstructor.setAccessible(true);
        Object o = declaredConstructor.newInstance(null);
        System.out.println(o);
    }
}
